home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / try_qb / whereis.bas (.txt) < prev   
QuickBASIC Tokenized Source  |  1989-12-04  |  4KB  |  71 lines

  1. EOFTYPE
  2. FILETYPE
  3. DIRTYPE
  4. ScanDir3
  5. PathSpec
  6. Level
  7. FileSpec
  8. MakeFileName
  9. GetEntry
  10. FileNum
  11.     EntryType
  12. RightCh
  13.     EntryLine
  14. TestCh
  15.     EntryName
  16. EntryExt
  17. TempSpec
  18. DirEntry
  19. NewPath
  20.  Declare symbolic constants used in program:
  21. File to look for
  22. Enter the directory where the search should start"
  23. (optional drive + directories). Press <ENTER> to begin
  24. the search in the root directory of the current drive.
  25. Starting directory
  26.  Make the top level call (level 1) to begin the search:
  27.  Delete all temporary files createde
  28.  by the program.
  29. Search complete.
  30. ScanDir
  31. = SCANDIR 
  32.    This procedure recursively scans a directory for the=
  33.    file name entered by the user.n
  34.    NOTE: The SUB header doesn't use the STATIC keyword
  35.      since this procedure needs a new set of variables
  36.      each time it is invoked.d
  37. Now searching"
  38.  Make a file specification for the temporary file:
  39.  Get a directory listing of the current directory, and
  40.  save it in the temporary file: 
  41.  Get the next available file number:
  42.  Open the DIR listing file and scan it: 
  43.  Process the file, one line at a time:
  44.  Get an entry from the DIR listing:m
  45.  If entry is a file:
  46.  If the FileSpec$ string matches, print entry and,
  47.  exit this loop:
  48.  If the entry is a directory, then make a recursive
  49.  call to ScanDir with the new directory:
  50. Now searching"
  51.  Scan on this DIR listing file is finished, so close it:
  52. MakeFileName
  53. = MAKEFILENAME$ 
  54.  This procedure makes a file name from a root string
  55.  ("TWH" - defined as a symbolic constant at the module
  56.  level) and a number passed to it as an argument (Num).
  57. GetEntry
  58. = GETENTRY 
  59.  This procedure processes entry lines in a DIR listing
  60.  saved to a file.r
  61.  Loop until a valid entry or end-of-file (EOF) is read:=
  62.  Get first character from the line for test:
  63.  Entry or EOF found, decide which:
  64.  Not EOF, either a file or a directory.:
  65.  Build and return the entry name:d
  66.  Test for extension and add to name if there is one:
  67.  Determine the entry type, and return that
  68.  value to the point where GetEntry$ was called: 
  69.  Directory
  70.  Filec
  71.